home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / tex-k / tex-k-archive / 000039_janl@math.uio.no_Tue Mar 7 23:10:44 1995.msg < prev    next >
Internet Message Format  |  1995-03-08  |  2KB

  1. Received: from ifi.uio.no by cs.umb.edu with SMTP id AA20597
  2.   (5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Tue, 7 Mar 1995 16:11:06 -0500
  3. Received: from pat.uio.no (pat.uio.no [129.240.2.50]) by ifi.uio.no with SMTP (8.6.10/ifi2.4) 
  4.     id <WAA08912@ifi.uio.no> for <tex-k%cs.umb.edu@ifi.uio.no> ; Tue, 7 Mar 1995 22:11:04 +0100
  5. Received: from ulrik.uio.no by pat.uio.no with local-SMTP (PP) 
  6.           id <23027-0@pat.uio.no>; Tue, 7 Mar 1995 22:10:47 +0100
  7. Received: from mnemosyne.uio.no by gilgamesj.uio.no ;
  8.           Tue, 7 Mar 1995 22:10:46 +0100
  9. Message-Id: <199503072110.WAA25440@gilgamesj.uio.no>
  10. To: tex-k <tex-k@cs.umb.edu>
  11. Reply-To: janl@math.uio.no
  12. Subject: using texmf.cnf in shell scripts
  13. Date: Tue, 07 Mar 1995 22:10:44 +0100
  14. From: Nicolai Langfeldt <janl@math.uio.no>
  15.  
  16.  
  17. I suddenly got a urge to use texmf.cnf values in shell scripts (in
  18. MakeTeXPK to be exact).  Not the full functionality as in kpathsea,
  19. that's rather complexe of course.  But at least it works for my
  20. purpose, supplied her in the hopes someone find it useful. place a
  21. 'set -x' in it until you're sure you know it works the way you think
  22. it does.
  23.  
  24. #!/bin/sh
  25. _TEXMF_CNF=${TEXMF_CNF:-/usr/local/lib/tex}/texmf.cnf
  26.  
  27. # This function extracts a variable value from a texmf.cnf file
  28. extract () {
  29.         eval `sed -e "/^$1[ =]/!d" -e 's/ //g' $_TEXMF_CNF`
  30.         export "$1"
  31. }
  32.  
  33. # Demo (TEXROOT is part of my texmf.cnf):
  34. extract TEXROOT
  35. extract TEXMF
  36. echo root: $TEXROOT
  37. echo mf: $TEXMF
  38.  
  39. Nicolai